<template>
  <el-dialog :title="info.title" :model-value="visible" @close="onClose" :width="500" >
    <span v-if="[1, 3, 4, 5, 8,10,11].includes(info.type)">是否{{ info.title }}？</span>
    <el-form v-else ref="form" size="small" label-width="80px" :rules="rules">
      <el-row gutter="30">
        <el-col :xl="22">
          <el-form-item label-width="20%" :label="'选择用户'">
            <el-input v-model="userName" @click="show" readonly>
              <template #suffix>
                <i class="el-icon-search el-input__icon"> </i>
              </template>
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button size="small" @click="$emit('submit', info.type)" type="primary">确定</el-button>
      <el-button size="small" @click="onClose">取消</el-button>
    </template>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {}
  },
  components: {},
  computed: {},
  emits: ['update:visible', 'update:dialogUser', 'submit'],
  props: {
    visible: Boolean,
    info: Object,
    dialogUser: Boolean,
    radio: Boolean,
    userName: {
      type: String,
      defalut: () => {
        return ''
      },
    },
  },
  methods: {
    show() {
      this.$emit('update:radio', this.info.type !== 9)
      this.$emit('update:dialogUser', true)
    },
    onClose() {
      this.$emit('update:visible', false)
    },
  },
}
</script>

<style lang='scss' scoped></style>
